// 调试日志保存 使用方法 logDebug(currentFile,,xxx,xxxx)  xxxx 不限制
const logDebug = require('../logs/log_debug') // 日志工具
const { join } = require('path')  // 路径
const currentFile = join(__filename)
// const moment = require('moment')
// const { mobuzDb } = require('../lib/utils')
// const { analysisRequestMessage, compileResponseMessage } = require('../lib/buffer');
// const { integralSmsPush } = require('../lib/smspush')

// 数据库
const { mobuzDb, mobuzWx } = require('../config')

// 测试接口
const testPort = async (ctx, next) => {
    logDebug(currentFile, '测试接口')
    // const {} = ctx.request.body
    // console.log(ctx, '...ctx')
    try {
        const mOrderInfo = await mobuzDb('m_order')
                                .select()
                                .where({'order_id': '109577496049542439'})
                                .first()
        // console.log(mOrderInfo, 'mOrderInfo')

        const wxOrderInfo = await mobuzWx('wx_order_manage')
                                .select()
                                .where({'order_id': '20190418153600996'})
                                .first()
        // console.log(wxOrderInfo, 'wxOrderInfo')
    } catch (error) {
        ctx.state.data = {
            status: 500,
            msg: error
        }
    }
}

module.exports = {
    testPort
}